// pagesEnterprise/component/housingItem/housingItem.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    entity: Object,
    status: {
      type: String,
      value: '0'
    },
    edit: String
  },
  /**
   * 组件的初始数据
   */
  data: {

    swiperIndex: 1
  },

  /**
   * 组件的方法列表
   */
  methods: {
    housingEvent() {
      const { status, entity, edit } = this.data
      if (status == '3') return this.triggerEvent('backEvent', entity)
      const url = status == '0' ? `/pagesEnterprise/pages/housingDetail/housingDetail?detailId=${entity.id}&edit=${edit}` : `/pagesEnterprise/pages/housingInsert/housingInsert?detailId=${entity.id}`
      wx.navigateTo({ url })
    },
    swiperChange(event) {
      this.setData({ swiperIndex: event.detail.current + 1 })
    },
  }
})
